package com.minimalist.common.entity.lindi.vo.tradeapplicationinvoice;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.entity.basic.vo.file.FileVO;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;


import java.io.Serial;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * @author 11987
 */

@Schema(name = "林地指标交易平台_交易申请发票管理实体")
public class LindiTradeApplicationInvoiceVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "发票ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "invoiceId", description = "发票ID", type = "string")
    private Long invoiceId;

    @NotNull(message = "交易申请ID不能为空", groups = {Add.class, Update.class})
    @Schema(name = "tradeApplicationId", description = "交易申请ID", type = "string")
    private Long tradeApplicationId;

    @Schema(name = "invoiceFileId", description = "发票文件ID", type = "string")
    private Long invoiceFileId;

    @Schema(name = "invoiceFile", description = "发票文件", type = "object")
    private FileVO invoiceFile;

    @NotBlank(message = "发票编号不能为空", groups = {Add.class, Update.class})
    @Schema(name = "invoiceNumber", description = "发票编号", type = "string")
    private String invoiceNumber;

    @NotBlank(message = "发票类型不能为空", groups = {Add.class, Update.class})
    @Schema(name = "invoiceType", description = "发票类型", type = "string")
    private String invoiceType;

    @NotBlank(message = "发票金额不能为空", groups = {Add.class, Update.class})
    @Schema(name = "invoiceMoney", description = "发票金额", type = "string")
    private String invoiceMoney;

    @Schema(name = "invoiceDate", description = "开票日期", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private Timestamp invoiceDate;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    public LindiTradeApplicationInvoiceVO() {
    }

    public LindiTradeApplicationInvoiceVO(Long invoiceId, Long tradeApplicationId, Long invoiceFileId, FileVO invoiceFile, String invoiceNumber, String invoiceType, String invoiceMoney, Timestamp invoiceDate, Long createId, Long updateId, LocalDateTime createTime, LocalDateTime updateTime) {
        this.invoiceId = invoiceId;
        this.tradeApplicationId = tradeApplicationId;
        this.invoiceFileId = invoiceFileId;
        this.invoiceFile = invoiceFile;
        this.invoiceNumber = invoiceNumber;
        this.invoiceType = invoiceType;
        this.invoiceMoney = invoiceMoney;
        this.invoiceDate = invoiceDate;
        this.createId = createId;
        this.updateId = updateId;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public Long getInvoiceId() {
        return invoiceId;
    }

    public void setInvoiceId(Long invoiceId) {
        this.invoiceId = invoiceId;
    }

    public Long getTradeApplicationId() {
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId) {
        this.tradeApplicationId = tradeApplicationId;
    }

    public Long getInvoiceFileId() {
        return invoiceFileId;
    }

    public void setInvoiceFileId(Long invoiceFileId) {
        this.invoiceFileId = invoiceFileId;
    }

    public FileVO getInvoiceFile() {
        return invoiceFile;
    }

    public void setInvoiceFile(FileVO invoiceFile) {
        this.invoiceFile = invoiceFile;
    }

    public String getInvoiceNumber() {
        return invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber) {
        this.invoiceNumber = invoiceNumber;
    }

    public String getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(String invoiceType) {
        this.invoiceType = invoiceType;
    }

    public String getInvoiceMoney() {
        return invoiceMoney;
    }

    public void setInvoiceMoney(String invoiceMoney) {
        this.invoiceMoney = invoiceMoney;
    }

    public Timestamp getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(Timestamp invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public Long getCreateId() {
        return createId;
    }

    public void setCreateId(Long createId) {
        this.createId = createId;
    }

    public Long getUpdateId() {
        return updateId;
    }

    public void setUpdateId(Long updateId) {
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LindiTradeApplicationInvoiceVO that = (LindiTradeApplicationInvoiceVO) o;
        if (invoiceId != null ? !invoiceId.equals(that.invoiceId) : that.invoiceId != null) return false;
        if (tradeApplicationId != null ? !tradeApplicationId.equals(that.tradeApplicationId) : that.tradeApplicationId != null) return false;
        if (invoiceFileId != null ? !invoiceFileId.equals(that.invoiceFileId) : that.invoiceFileId != null) return false;
        if (invoiceFile != null ? !invoiceFile.equals(that.invoiceFile) : that.invoiceFile != null) return false;
        if (invoiceNumber != null ? !invoiceNumber.equals(that.invoiceNumber) : that.invoiceNumber != null) return false;
        if (invoiceType != null ? !invoiceType.equals(that.invoiceType) : that.invoiceType != null) return false;
        if (invoiceMoney != null ? !invoiceMoney.equals(that.invoiceMoney) : that.invoiceMoney != null) return false;
        if (invoiceDate != null ? !invoiceDate.equals(that.invoiceDate) : that.invoiceDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (updateId != null ? !updateId.equals(that.updateId) : that.updateId != null) return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        return true;
    }

    @Override
    public int hashCode() {
        int result = invoiceId != null ? invoiceId.hashCode() : 0;
        result = 31 * result + (tradeApplicationId != null ? tradeApplicationId.hashCode() : 0);
        result = 31 * result + (invoiceFileId != null ? invoiceFileId.hashCode() : 0);
        result = 31 * result + (invoiceFile != null ? invoiceFile.hashCode() : 0);
        result = 31 * result + (invoiceNumber != null ? invoiceNumber.hashCode() : 0);
        result = 31 * result + (invoiceType != null ? invoiceType.hashCode() : 0);
        result = 31 * result + (invoiceMoney != null ? invoiceMoney.hashCode() : 0);
        result = 31 * result + (invoiceDate != null ? invoiceDate.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (updateId != null ? updateId.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }

    public static LindiTradeApplicationInvoiceVOBuilder builder() {
        return new LindiTradeApplicationInvoiceVOBuilder();
    }

    public static class LindiTradeApplicationInvoiceVOBuilder {
        private Long invoiceId;
        private Long tradeApplicationId;
        private Long invoiceFileId;
        private FileVO invoiceFile;
        private String invoiceNumber;
        private String invoiceType;
        private String invoiceMoney;
        private Timestamp invoiceDate;
        private Long createId;
        private Long updateId;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;

        LindiTradeApplicationInvoiceVOBuilder() {
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceId(Long invoiceId) {
            this.invoiceId = invoiceId;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder tradeApplicationId(Long tradeApplicationId) {
            this.tradeApplicationId = tradeApplicationId;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceFileId(Long invoiceFileId) {
            this.invoiceFileId = invoiceFileId;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceFile(FileVO invoiceFile) {
            this.invoiceFile = invoiceFile;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceNumber(String invoiceNumber) {
            this.invoiceNumber = invoiceNumber;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceType(String invoiceType) {
            this.invoiceType = invoiceType;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceMoney(String invoiceMoney) {
            this.invoiceMoney = invoiceMoney;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder invoiceDate(Timestamp invoiceDate) {
            this.invoiceDate = invoiceDate;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder createId(Long createId) {
            this.createId = createId;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder updateId(Long updateId) {
            this.updateId = updateId;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder createTime(LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public LindiTradeApplicationInvoiceVOBuilder updateTime(LocalDateTime updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public LindiTradeApplicationInvoiceVO build() {
            return new LindiTradeApplicationInvoiceVO(invoiceId, tradeApplicationId, invoiceFileId, invoiceFile, invoiceNumber, invoiceType, invoiceMoney, invoiceDate, createId, updateId, createTime, updateTime);
        }

        public String toString() {
            return "LindiTradeApplicationInvoiceVO.LindiTradeApplicationInvoiceVOBuilder(invoiceId=" + this.invoiceId + ", tradeApplicationId=" + this.tradeApplicationId + ", invoiceFileId=" + this.invoiceFileId + ", invoiceFile=" + this.invoiceFile + ", invoiceNumber=" + this.invoiceNumber + ", invoiceType=" + this.invoiceType + ", invoiceMoney=" + this.invoiceMoney + ", invoiceDate=" + this.invoiceDate + ", createId=" + this.createId + ", updateId=" + this.updateId + ", createTime=" + this.createTime + ", updateTime=" + this.updateTime + ")";
        }
    }

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;
}
